package Pattern.SinglePattern.SingleTest;

public class Singleton2 {
    private static volatile Singleton2 instance;//同步
    public static String value;
    private Singleton2(String value){
        this.value = value;
    }
    public static Singleton2 getInstance(String value){
        if (instance == null){
            synchronized (Singleton.class){
                if (instance == null) instance = new Singleton2(value);
            }
        }
        return instance;
    }
}
